<template>
    <div class="b-title d-flex align-center">
        <img :src="icon" class="title-icon" v-if="icon" />
        <slot></slot>
        <span class="title-tip c-title-1">{{ title }}</span>
        <div v-if="isMore" @click="onClick" class="more-box main-color2">
            <span class="title-more c-title-3">
                <!-- 更多 -->
                {{ $t("message.NavTitle.a") }}
            </span>
            <span class="iconfont icon-gengduo"></span>
        </div>
    </div>
</template>

<script lang="ts" setup>
// import { defineEmits } from "vue"
const props = defineProps({
    isMore: {
        type: Boolean,
        default: true
    },
    title: {
        type: String,
        default: ""
    },
    icon: {
        type: String,
        default: ""
    }
});
const emits = defineEmits(["more"]);
const onClick = () => {
    emits("more");
};
</script>

<style lang="less" scoped>
.b-title {
    //     font-size: 21px;
    //     color: #FFFFFF;
    margin-top: 30px;
    margin-left: 30px;
    margin-right: 30px;
    margin-bottom: 18px;

    .title-icon {
        width: 20px;
        height: 20px;
    }

    .title-tip {
        color: #ffffff;
        flex: 1;
        margin-left: 10px;
    }

    .title-more {
        margin-right: 4px;
    }
    .more-box {
        cursor: pointer;
        transition: all 0.2s;
        &:hover {
            opacity: 0.8;
        }
    }
}
.main-color2 {
    color: #b1b6c6;
    &:hover {
        color: var(--main);
    }
}
</style>
